home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / vsix60.exe / lha / ERRORSYS.LZH / ERRORSYS.PRG < prev   
Text File  |  1990-08-31  |  9KB  |  362 lines

  1. * ERRORSYS.PRG - The Clipper Error System
  2. * Copyright (c) 1990 by Vernon E. Six, Jr.
  3. * All Rights Reserved World Wide
  4. *
  5. * Written by:  Vernon E. Six, Jr.
  6. *              1333 West Campbell Road, #151
  7. *              Richardson, Texas  75080
  8. *
  9. * Last Update: Sun  08-05-1990  19:24:35
  10. *
  11.  
  12. *****************************************************************************
  13.  
  14. FUNCTION db_error
  15. PARAMETERS pc_name, pn_line, pc_info
  16.  
  17.    PRIVATE c_response
  18.  
  19.    SET DEVICE TO SCREEN
  20.  
  21.    c_response = ERROR_MSG("DB_ERROR", pc_name, pn_line, pc_info)
  22.  
  23.    DO CASE
  24.  
  25.       CASE c_response $ "Aa"   && Abort
  26.          SET CURSOR ON
  27.          SET COLOR TO W/N
  28.          @ 23, 0 CLEAR
  29.          QUIT
  30.  
  31.       CASE c_response $ "Rr"   && Retry
  32.          RETURN(.T.)
  33.  
  34.       CASE c_response $ "Ii"   && Ignore
  35.          BREAK
  36.  
  37.    ENDCASE
  38.  
  39. RETURN(.F.)
  40.  
  41. *****************************************************************************
  42.  
  43. FUNCTION expr_error
  44. PARAMETERS pc_name, pn_line, pc_info, pc_operation, ;
  45.            pc_op1, pc_op2, pc_op3, pc_op4, pc_op5
  46.  
  47.    PRIVATE c_response
  48.                                                                    
  49.    SET DEVICE TO SCREEN
  50.  
  51.    pc_op1 = IF( TYPE("pc_op1") == "U", "<none>", pc_op1)
  52.    pc_op2 = IF( TYPE("pc_op2") == "U", "<none>", pc_op2)
  53.    pc_op3 = IF( TYPE("pc_op3") == "U", "<none>", pc_op3)
  54.    pc_op4 = IF( TYPE("pc_op4") == "U", "<none>", pc_op4)
  55.    pc_op5 = IF( TYPE("pc_op5") == "U", "<none>", pc_op5)
  56.  
  57.    c_response = ERROR_MSG("EXPR_ERROR", pc_name, pn_line, pc_info, ;
  58.                      pc_operation, pc_op1, pc_op2, pc_op3, pc_op4, pc_op5)
  59.  
  60.    DO CASE
  61.  
  62.       CASE c_response $ "Aa"   && Abort
  63.          SET CURSOR ON
  64.          SET COLOR TO W/N
  65.          @ 23, 0 CLEAR
  66.          QUIT
  67.  
  68.       CASE c_response $ "Rr"   && Retry
  69.          BREAK
  70.  
  71.       CASE c_response $ "Ii"   && Ignore
  72.          BREAK
  73.  
  74.    ENDCASE
  75.  
  76. RETURN(.F.)
  77.  
  78. *****************************************************************************
  79.  
  80. FUNCTION misc_error
  81. PARAMETERS pc_name, pn_line, pc_info, pc_operation
  82.  
  83.    PRIVATE c_response
  84.  
  85.    SET DEVICE TO SCREEN
  86.  
  87.    c_response = ERROR_MSG("MISC_ERROR", pc_name, pn_line, pc_info, ;
  88.                           pc_operation)
  89.  
  90.    DO CASE
  91.  
  92.       CASE c_response $ "Aa"   && Abort
  93.          SET CURSOR ON
  94.          SET COLOR TO W/N
  95.          @ 23, 0 CLEAR
  96.          QUIT
  97.  
  98.       CASE c_response $ "Rr"   && Retry
  99.          RETURN(.T.)
  100.  
  101.       CASE c_response $ "Ii"   && Ignore
  102.          BREAK
  103.  
  104.    ENDCASE
  105.  
  106. RETURN(.F.)
  107.  
  108. *****************************************************************************
  109.  
  110. FUNCTION open_error
  111. PARAMETERS pc_name, pn_line, pc_info, pc_operation, pc_op1
  112.  
  113.    IF NETERR() .AND. pc_operation == "USE"
  114.       RETURN .F.
  115.    ENDIF
  116.  
  117.    SET DEVICE TO SCREEN
  118.  
  119.    pc_op1 = IF( TYPE("pc_op1") == "U", "<none>" , pc_op1)
  120.  
  121.    c_response = ERROR_MSG("OPEN_ERROR", pc_name, pn_line, pc_info, ;
  122.                           pc_operation, pc_op1)
  123.  
  124.    DO CASE
  125.  
  126.       CASE c_response $ "Aa"   && Abort
  127.          SET CURSOR ON
  128.          SET COLOR TO W/N
  129.          @ 23, 0 CLEAR
  130.          QUIT
  131.  
  132.       CASE c_response $ "Rr"   && Retry
  133.          RETURN(.T.)
  134.  
  135.       CASE c_response $ "Ii"   && Ignore
  136.          BREAK
  137.  
  138.    ENDCASE
  139.  
  140. RETURN(.F.)
  141.  
  142. *****************************************************************************
  143.  
  144. FUNCTION print_error
  145. PARAMETERS pc_name, pn_line
  146.  
  147.    SET DEVICE TO SCREEN
  148.  
  149.    c_response = ERROR_MSG("PRINT_ERROR", pc_name, pn_line)
  150.  
  151.    DO CASE
  152.  
  153.       CASE c_response $ "Aa"   && Abort
  154.          SET CURSOR ON
  155.          SET COLOR TO W/N
  156.          @ 23, 0 CLEAR
  157.          QUIT
  158.  
  159.       CASE c_response $ "Rr"   && Retry
  160.          RETURN(.T.)
  161.  
  162.       CASE c_response $ "Ii"   && Ignore
  163.          BREAK
  164.  
  165.    ENDCASE
  166.  
  167. RETURN(.F.)
  168.  
  169.  
  170. *****************************************************************************
  171.  
  172. FUNCTION undef_error
  173. PARAMETERS pc_name, pn_line, pc_info, pc_operation, pc_op1
  174.  
  175.    PRIVATE c_response
  176.    
  177.    SET DEVICE TO SCREEN
  178.  
  179.    pc_op1 = IF( TYPE("pc_op1") == "U", "<none>" , pc_op1)
  180.    
  181.    c_response = ERROR_MSG("UNDEF_ERROR", pc_name, pn_line, pc_operation, pc_op1)
  182.  
  183.    DO CASE
  184.  
  185.       CASE c_response $ "Aa"   && Abort
  186.          SET CURSOR ON
  187.          SET COLOR TO W/N
  188.          @ 23, 0 CLEAR
  189.          QUIT
  190.  
  191.       CASE c_response $ "Rr"   && Retry
  192.          RETURN(.T.)
  193.  
  194.       CASE c_response $ "Ii"   && Ignore
  195.          BREAK
  196.  
  197.    ENDCASE
  198.  
  199. RETURN(.F.)
  200.  
  201. *****************************************************************************
  202.  
  203. FUNCTION error_msg
  204. PARAMETERS pc_proc, pc_name, pn_line, pc_info, pc_operation, ;
  205.            pc_op1, pc_op2, pc_op3, pc_op5, pc_op6
  206.  
  207. PRIVATE n_dos_err, n_return, ac_err[88]
  208.  
  209. pc_info      = IF( "U"$TYPE("pc_info"), "<none>", pc_info)
  210. pc_operation = IF( "U"$TYPE("pc_operation"), "<none>", pc_operation)
  211.  
  212. pc_op1 = IF( TYPE("pc_op1") == "U", "<none>", pc_op1)
  213. pc_op2 = IF( TYPE("pc_op2") == "U", "<none>", pc_op2)
  214. pc_op3 = IF( TYPE("pc_op3") == "U", "<none>", pc_op3)
  215. pc_op4 = IF( TYPE("pc_op4") == "U", "<none>", pc_op4)
  216. pc_op5 = IF( TYPE("pc_op5") == "U", "<none>", pc_op5)
  217.  
  218. ac_err[ 1] = "Invalid function number"
  219. ac_err[ 2] = "File not found"
  220. ac_err[ 3] = "Path not found"
  221. ac_err[ 4] = "Too many open files (no handles left)"
  222. ac_err[ 5] = "Access denied"
  223. ac_err[ 6] = "Invalid handle"
  224. ac_err[ 7] = "Memory control blocks destroyed"
  225. ac_err[ 8] = "Insufficient memory"
  226. ac_err[ 9] = "Invalid memory block address"
  227. ac_err[10] = "Invalid environment"
  228. ac_err[11] = "Invalid format"
  229. ac_err[12] = "Invalid access code"
  230. ac_err[13] = "Invalid data"
  231. ac_err[14] = "Reserved"
  232. ac_err[15] = "Invalid drive was specified"
  233. ac_err[16] = "Attempt to remove the current directory"
  234. ac_err[17] = "Not same device"
  235. ac_err[18] = "No more files"
  236. ac_err[19] = "Attempted write on write-protected disk"
  237. ac_err[20] = "Unknown unit"
  238. ac_err[21] = "Drive not ready"
  239. ac_err[22] = "Unknown command"
  240. ac_err[23] = "Data error (CRC)"
  241. ac_err[24] = "Bad request structure length"
  242. ac_err[25] = "Seek error"
  243. ac_err[26] = "Unknown media type"
  244. ac_err[27] = "Sector not found"
  245. ac_err[28] = "Printer out of paper"
  246. ac_err[29] = "Write fault"
  247. ac_err[30] = "Read fault"
  248. ac_err[31] = "General failure"
  249. ac_err[32] = "Sharing violation"
  250. ac_err[33] = "Lock violation"
  251. ac_err[34] = "Invalid disk change"
  252. ac_err[35] = "FCB unavailable"
  253. ac_err[36] = "Sharing buffer overflow"
  254. ac_err[37] = "Reserved"
  255. ac_err[38] = "Reserved"
  256. ac_err[39] = "Reserved"
  257. ac_err[40] = "Reserved"
  258. ac_err[41] = "Reserved"
  259. ac_err[42] = "Reserved"
  260. ac_err[43] = "Reserved"
  261. ac_err[44] = "Reserved"
  262. ac_err[45] = "Reserved"
  263. ac_err[46] = "Reserved"
  264. ac_err[47] = "Reserved"
  265. ac_err[48] = "Reserved"
  266. ac_err[49] = "Reserved"
  267. ac_err[50] = "Network request not supported"
  268. ac_err[51] = "Remote computer not listening"
  269. ac_err[52] = "Duplicate name on network"
  270. ac_err[53] = "Network name not found"
  271. ac_err[54] = "Network busy"
  272. ac_err[55] = "Network device no longer exists"
  273. ac_err[56] = "Network BIOS command limit exceeded"
  274. ac_err[57] = "Network adapter hardware error"
  275. ac_err[58] = "Incorrect response from network"
  276. ac_err[59] = "Unexpected network error"
  277. ac_err[60] = "Incompatible remote adapter"
  278. ac_err[61] = "Print queue full"
  279. ac_err[62] = "Not enough space for print file"
  280. ac_err[63] = "Print file deleted (not enough space)"
  281. ac_err[64] = "Network name deleted"
  282. ac_err[65] = "Access denied"
  283. ac_err[66] = "Network device type incorrect"
  284. ac_err[67] = "Network name not found"
  285. ac_err[68] = "Network name limit exceeded"
  286. ac_err[69] = "Network BIOS session limit exceeded"
  287. ac_err[70] = "Temporarily paused"
  288. ac_err[71] = "Network request not accepted"
  289. ac_err[72] = "Print or disk redirection paused"
  290. ac_err[73] = "Reserved"
  291. ac_err[74] = "Reserved"
  292. ac_err[75] = "Reserved"
  293. ac_err[76] = "Reserved"
  294. ac_err[77] = "Reserved"
  295. ac_err[78] = "Reserved"
  296. ac_err[79] = "Reserved"
  297. ac_err[80] = "File already exists"
  298. ac_err[81] = "Reserved"
  299. ac_err[82] = "Cannot make directory entry"
  300. ac_err[83] = "Fail on INT 24H"
  301. ac_err[84] = "Too many redirections"
  302. ac_err[85] = "Duplicate redirection"
  303. ac_err[86] = "Invalid password"
  304. ac_err[87] = "Invalid parameter"
  305. ac_err[88] = "Network device fault"
  306.  
  307. GRABSCRN()
  308.  
  309.    VWIND(2,16,22,63,"Warning: "+pc_proc,"")
  310.  
  311.    @ 04,18 SAY "  Process: " + pc_name
  312.    @ 05,18 SAY "     Line: " + ALLTRIM(STR(pn_line))
  313.    @ 06,18 SAY "     Info: " + pc_info
  314.    @ 07,18 SAY "Operation: " + pc_operation
  315.  
  316.    @ 08,18 SAY "   Parm 1: "
  317.    @ 08,29 SAY pc_op1
  318.  
  319.    @ 09,18 SAY "   Parm 2: "
  320.    @ 09,29 SAY pc_op2
  321.  
  322.    @ 10,18 SAY "   Parm 3: "
  323.    @ 10,29 SAY pc_op3
  324.  
  325.    @ 11,18 SAY "   Parm 4: "
  326.    @ 11,29 SAY pc_op4
  327.  
  328.    @ 12,18 SAY "   Parm 5: "
  329.    @ 12,29 SAY pc_op5
  330.  
  331.    n_dos_err = Doserror()
  332.    @ 13,18 SAY "  Message : " + IF(n_dos_err == 0, "<unspecified>", ac_err[n_dos_err])
  333.    @ 14,18 SAY " "
  334.    @ 15,18 SAY "An error has occurred, please write down the"
  335.    @ 16,18 SAY "information provided and select one of the  "
  336.    @ 17,18 SAY "following courses of action.                "
  337.    @ 18,18 SAY " "
  338.    @ 19,18 SAY " "
  339.        
  340.    CLEAR TYPEAHEAD
  341.        
  342.  
  343.    @ 20,27 PROMPT "Abort"
  344.    @ 20,36 PROMPT "Retry"
  345.    @ 20,46 PROMPT "Ignore"
  346.    MENU TO n_return
  347.  
  348. PUTSCRN()
  349.  
  350. DO CASE
  351.    CASE n_return = 2
  352.       RETURN("R")
  353.    CASE n_return = 3
  354.       RETURN("I")
  355. ENDCASE
  356.  
  357. RETURN("A")
  358.  
  359. *****************************************************************************
  360.  
  361.  
  362.